home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 050 / bix03.arc / SAVE.SYS < prev    next >
Text File  |  1986-08-04  |  3KB  |  72 lines

  1. (********************************************************************)
  2. (*                                                                  *)
  3. (*            DISPLAY AND WINDOW   DISK I/O UTILITIES               *)
  4. (*                                                                  *)
  5. (*      Assist in the storage and retrieval of display screens,     *)
  6. (*      display stacks, windows, and window stacks.                 *)
  7. (*                                                                  *)
  8. (*                                                                  *)
  9. (*                                                                  *)
  10. (*       written by:      John Leonard    1/9/86                    *)
  11. (*                                                                  *)
  12. (*          NOT FOR SALE WITHOUT WRITTEN PERMISSION                 *)
  13. (*                                                                  *)
  14. (********************************************************************)
  15.  
  16.  
  17. procedure SaveDisplay( DisplayNo : integer; filename: Window_Big_String);
  18.    var
  19.       displayrec  : Display_Record;
  20.       displayfile : file of Display_Record;
  21.    begin
  22.       assign(displayfile,filename);
  23.       {i-} rewrite(displayfile) {i+};
  24.       if IOResult <> 0 then begin
  25.          WindowExit;
  26.          writeln;
  27.          writeln('Fatal Error ReWriting Displayfile ',filename,'.');
  28.          halt;
  29.       end;
  30.       if DisplayStack[DisplayNo] <> nil then begin
  31.  
  32.          move( CurrentScreenData.windowloc[displayno],
  33.                displayrec.info,
  34.                sizeof( CurrentScreenData.windowloc[displayno]));
  35.          move( DisplayStack[DisplayNo]^,
  36.                displayrec.data,
  37.                sizeof( DisplayStack[DisplayNo]^));
  38.  
  39.          write(displayfile,Displayrec);
  40.  
  41.       end;
  42.       close(displayfile);
  43.    end;
  44.  
  45.  
  46. procedure LoadDisplay( DisplayNo : integer; filename: Window_Big_String);
  47.    var
  48.       displayrec  : Display_Record;
  49.       displayfile : file of Display_Record;
  50.    begin
  51.       assign(displayfile,filename);
  52.       {i-} reset(displayfile) {i+};
  53.       if IOResult <> 0 then begin
  54.          WindowExit;
  55.          writeln;
  56.          writeln('Fatal Error: ',filename,' doesn''t exist.');
  57.          halt;
  58.       end;
  59.       if DisplayStack[DisplayNo] = nil then
  60.          ClearPage(DisplayNo);
  61.  
  62.       read( displayfile,DisplayRec);
  63.  
  64.       move( displayrec.info,
  65.             CurrentScreenData.windowloc[DisplayNo],
  66.             sizeof(displayrec.info) );
  67.       move( displayrec.data,
  68.             DisplayStack[DisplayNo]^,
  69.             sizeof( displayrec.data) );
  70.       close(displayfile);
  71.    end;
  72.